# 阶梯电价计算电费

sy = eval(input("输入上月电表度数"))
by = eval(input("输入本月电表度数"))
yf = eval(input("输入月份"))

ds = by - sy
df = 0
if ds < 200:
    df = ds * 0.588
else:
    if 3 <= yf <= 5 or 9 <= yf <= 11:
        if ds <= 350:
            df = 200 * 0.588 + 0.638 * (ds - 200)
        else:
            df = 200 * 0.588 + 0.638 * 150 + 0.888 * (ds - 350)
    else:
        if ds <= 450:
            df = 200 * 0.588 + 0.638 * (ds - 200)
        else:
            df = 200 * 0.588 + 0.638 * 250 + 0.888 * (ds - 450)

print("{:.2f}  {:.2f}".format(ds, df))
